package com.hyq.builder;

import java.util.ArrayList;
import java.util.List;

/**
* @ClassName: GameServer 
* @Description: 定义游戏服务器
* @author Janus
 */
public abstract class GameServer {
	//定义游戏玩家执行顺序
	private List<String> sequence=new ArrayList<String>();
	//游戏开始升级
	protected abstract void upgrade();
	//游戏搞装备,人民币战士可以直接购买装备
	protected abstract void equipment();
	//游戏给升级装备
	protected abstract void equipmentUp();
	//游戏等级上来了，装备好了，当然要打Boss了
	protected abstract void fightBoss();
	//传入不同玩家的执行顺序
	final public void setSequence(List list){
		this.sequence=list;
	}
	//执行过程
	final public void run(){
		for (String type : sequence) {
			switch(type){
			case "upgrade":
				this.upgrade();
				break;
			case "equipment":
				this.equipment();
				break;
			case "equipmentUp":
				this.equipmentUp();
				break;
			case "fightBoss":
				this.fightBoss();
				break;
			}
		}
	}
	
}
